<!-- combogrid物料列表带搜索工具栏 -->
<div id="myToolbar" class="datagrid-toolbar">  
           
      <input type="text" id="mat_no_s" name="mat_no_s" style="width: 120px;"  
          class="easyui-textbox" />  
   
      <input type="text" id="mat_name_s" name="mat_name_s" style="width: 120px;"  
          class="easyui-textbox" />  
  	<a href="javascript:void(0)" class="easyui-linkbutton searchBtn" iconCls="glyphicon-search" plain="true" onclick="search_mat();">搜索</a>
    <a href="javascript:void(0)" class="easyui-linkbutton reloadBtn" iconCls="glyphicon-refresh" plain="true" onclick="reload_mat();">刷新</a>              
 </div>
 <script type="text/javascript">
 $('#mat_no').combogrid({    
	    panelWidth:450, 
	    panelHeight:250, 
	    idField:'mat_no', //ID字段    
	    textField:'mat_no', //显示的字段    
	    url:"${basePath}/wms/material/queryMatData",    
	    fitColumns: true,    
	    //striped: true,    
	    //editable:true,  
	    singleSelect:true,
	    pagination : true,//是否分页    
	    rownumbers:true,//序号    
	    //collapsible:false,//是否可折叠的    
	    //fit: true,//自动大小    
	    pageSize: 10,//每页显示的记录条数，默认为10    
	    //pageList: [10],//可以设置每页记录条数的列表    
	    method:'post',    
	    columns:[[   
	        {field:'mat_no',title:'物料编号',width:100,sortable:true},
	        {field:'mat_name',title:'物料名称',width:120}, 
	        {field:'mat_std',title:'物料规格',width:180}  
	    ]], 
	    toolbar:'#myToolbar',
	    onSelect: function () {              //选中处理  
	        $('#mat_name').textbox("setValue",$('#mat_no').combogrid('grid').datagrid('getSelected').mat_name);
	        $('#mat_std').textbox("setValue",$('#mat_no').combogrid('grid').datagrid('getSelected').mat_std);  
	    }  
	});   
	function search_mat() { 
		var param1;
		if($(":input[name='mat_name_s']").val()!=''){
		 param1 = {"queryParams[mat_name]": $(":input[name='mat_name_s']").val()};
		}
		if($(":input[name='mat_no_s']").val()!=''){
		 param1["queryParams[mat_no]"] =  $(":input[name='mat_no_s']").val();
		}
	    $('#mat_no').combogrid("grid").datagrid("reload", param1);  
	      
	}; 
	function reload_mat() {  
	    $('#mat_no').combogrid("grid").datagrid('reload',{});   
	    $('#mat_no').combogrid("grid").datagrid('clearSelections');  
	}  
</script>
